package com.bkhech.home.practice.spring.el.domain;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author guowm
 * @date 2023/1/16
 */
public class Society {
    private String name;
    private List<Inventor> members;
    private Map<String, Inventor> officers = new HashMap<>(16);

    public void setMembers(List<Inventor> members) {
        this.members = members;
    }

    public List<Inventor> getMembers() {
        return members;
    }

    public Map<String, Inventor> getOfficers() {
        return officers;
    }

    public void setOfficers(String title, Inventor inventor) {
        this.officers.put(title, inventor);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isMember(String name) {
        for (Inventor inventor : members) {
            if (inventor.getName().equals(name)) {
                return true;
            }
        }
        return false;
    }
}
